import Home from "@/views/home"
import Works from "@/views/works"
import Antds from "@/views/antds"
import Request from "@/views/request"
import My from "@/views/my"

// import { Routes, Route } from "react-router-dom" // react-router 6.16.0以上语法使用

import { Switch, Route, Redirect } from "react-router-dom" // react-router 5.2.0以上语法使用


function App() {
    return (
        <div className="App">
            <div className='container'>
                {/* <Routes>
                    <Route path="/home" element={<Home/>} />
                    <Route path="/works" element={<Works/>} />
                    <Route path="/antds" element={<Antds/>} />
                    <Route path="/request" element={<Request/>} />
                    <Route path="/my" element={<My/>} />
                </Routes> */}

                <Switch>
                    <Route path='/' exact render={()=> (<Redirect to='/home'/>)}/>
                    <Route path="/home" component={Home} />
                    <Route path="/works" component={Works} />
                    <Route path="/antds" component={Antds} />
                    <Route path="/request" component={Request} />
                    <Route path="/my" component={My} />
                </Switch>
            </div>
        </div>
    )
}

export default App
